﻿using System.Collections.Concurrent;

namespace Mohe.Scada.Util.Helper
{

    /// <summary>基于 System.Runtime.Caching 的内存缓存帮助类</summary>
    public class MemoryCacheHelper
    {
        private static readonly ConcurrentDictionary<string, object> _cache = new ConcurrentDictionary<string, object>();

        public static void Set(string key, object value)
        {
            _cache[key] = value;
        }

        public static object Get(string key)
        {
            _cache.TryGetValue(key, out object value);
            return value;
        }

    }
}
